package cn.com.lyj6851.modules.edu.controller;

import cn.com.lyj6851.api.ApiResult;
import cn.com.lyj6851.common.bean.LocalUser;
import cn.com.lyj6851.common.interceptor.AuthCheck;
import cn.com.lyj6851.logging.aop.AppLog;
import cn.com.lyj6851.modules.edu.service.EduStoreCartService;
import cn.com.lyj6851.modules.edu.vo.GoodsVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 学校APP购物车控制器
 * @author Administrator
 */
@Slf4j
@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@Api(value = "课程购物车", tags = "网校:购物车")
public class EduCartController {

    private final EduStoreCartService eduStoreCartService;

    /**
     * 购物车 获取数量
     */

    /**
     * 购物车 添加
     */


    /**
     * 购物车列表 cart
     */
    @AppLog(value = "查看购物车列表", type = 1)
    @AuthCheck
    @GetMapping("cart")
    @ApiOperation(value = "购物车列表",notes = "购物车列表")
    public ApiResult<List<GoodsVo>> getList(){
        Long uid = LocalUser.getUser().getUid();

        return ApiResult.ok(eduStoreCartService.getUserCartList(uid,"",null));
    }
    /**
     * 修改产品数量
     */

    /**
     * 购物车删除产品
     */

}
